# Maintainer: Bruno Pagani <archange@archlinux.org>
# Maintainer: Robin Candau <antiz@archlinux.org>

pkgname=dino
pkgver=0.4.3
pkgrel=3
pkgdesc="Modern XMPP (Jabber) chat client written in Vala"
arch=(loong64 x86_64)
url="https://dino.im"
license=(GPL3)
depends=(glib2 glib-networking gtk4 libadwaita gpgme libgee libgcrypt libsignal-protocol-c
         libsoup sqlite qrencode gspell libnice gstreamer gst-plugin-gtk
         gst-plugins-base gst-plugins-good libsrtp webrtc-audio-processing gdk-pixbuf2)
makedepends=(git cmake vala ninja)
source=(https://github.com/dino/dino/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz{,.asc})
sha256sums=('a615fc14d27402316d45036d55471d5ccb68194390e0654efb192f8de57b4b06'
            'SKIP')
validpgpkeys=(A32134DD19952FB12EC43E4501FABCC83FEA225E)

build() {
  cmake -G Ninja -B build -S ${pkgname}-${pkgver} \
    -DBUILD_TESTS='ON' \
    -DCMAKE_BUILD_TYPE='None' \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -Wno-dev
  ninja -C build
}

check() {
  build/xmpp-vala-test
  build/signal-protocol-vala-test
}

package() {
  DESTDIR="${pkgdir}" ninja -C build install
}
